<?php
return array( // database type name, refer to SzAbstractDb::$VALID_DB_TYPES
    // NORMAL
    'BATCH_INSERT_THRESHOLD' => 5,
    'Payment' => array( // database type of payment db is always "MySql"
        'DB_NAME' => $_ENV['PAYMENT_DB_NAME'],
        'READER_HOST' => [
            [$_ENV['PAYMENT_DB_HOST'], $_ENV['PAYMENT_DB_PORT']]
        ],
        'READER_USER' => $_ENV['PAYMENT_DB_USER'],
        'READER_PWD' => $_ENV['PAYMENT_DB_PASS'],
        'WRITER_HOST' => [$_ENV['PAYMENT_DB_HOST'], $_ENV['PAYMENT_DB_PORT']],
        'WRITER_USER' => $_ENV['PAYMENT_DB_USER'],
        'WRITER_PWD' => $_ENV['PAYMENT_DB_PASS'],
    ),
    // SHARD
    'SHARD_STRATEGY' => 'Fixed', // refer to SzAbstractDbFactory::SHARD_TYPE_*
    // DYNAMIC SHARD
    'SHARD_ESTIMATE_REGISTER_USER_COUNT' => 5000000, // always 1000 * x, this value cannot be changed after app goes online
    'SHARD_WEIGHT_MySql' => array( // refer to SzUtility::getRandomElementByProbability
        // shardId => probability
        0 => 500, // 50% shard 0
        1 => 500, // 50% shard 1
    ),
    'SHARD_WEIGHT_Redis' => array( // refer to SzUtility::getRandomElementByProbability
        0 => 0, // always shard 0
    ),
    // DB CONFIGS WITH TYPE
    'MySql' => array(
        array(
            'DB_NAME' => 'flowertown_0',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_1',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_2',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_3',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_4',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_5',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_6',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_7',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_8',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_9',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_10',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_11',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_12',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_13',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_14',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_15',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_16',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_17',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_18',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
        array(
            'DB_NAME' => 'flowertown_19',
            'READER_HOST' => array(
                [$_ENV['DB_HOST'], $_ENV['DB_PORT']]
            ),
            'READER_USER' => $_ENV['DB_USER'],
            'READER_PWD' => $_ENV['DB_PASS'],
            'WRITER_HOST' => [$_ENV['DB_HOST'], $_ENV['DB_PORT']],
            'WRITER_USER' => $_ENV['DB_USER'],
            'WRITER_PWD' => $_ENV['DB_PASS'],
        ),
    ),
    'Redis' => array(
        array(
            'DB_NAME' => $_ENV['REDIS_DB_NAME'],
            'READER_HOST' => [
                [$_ENV['REDIS_DB_HOST'], $_ENV['REDIS_DB_PORT']]
            ],
            'READER_USER' => $_ENV['REDIS_DB_USER'],
            'READER_PWD' => $_ENV['REDIS_DB_PASS'],
            'WRITER_HOST' => [$_ENV['REDIS_DB_HOST'], $_ENV['REDIS_DB_PORT']],
            'WRITER_USER' => $_ENV['REDIS_DB_USER'],
            'WRITER_PWD' => $_ENV['REDIS_DB_PASS'],
        )
    ),
);
